﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Zhaoxi.CorsSample.HttpApi.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class ContactController : ControllerBase
    {
        [HttpGet]
        public IActionResult Get()
        {
            var contacts = new[]
            {
                new Contact("张三", "123", "zhangsan@qq.com"),
                new Contact("李四","456", "lisi@qq.com"),
                new Contact("王五", "789", "wangwu@qq.com")
            };

            return Ok(contacts);
        }
    }
}
